
//
//  FCDrawerCenterController.m
//  FCChatAPP
//
//  Created by 岁变 on 2016/10/19.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import "FCDrawerCenterController.h"
#import "FCAddressController.h" //通讯录页面
#import "FCChatController.h"  //聊天信息页面
#import "FCSetController.h"  //设置页面

@interface FCDrawerCenterController ()

@end

@implementation FCDrawerCenterController

- (void)viewDidLoad {
    [super viewDidLoad];
    NSArray *array = @[@{@"className": @"UINavigationController",
                         @"tabbarTitle": @"消息",
                         @"imageName": @""},
                       @{@"className": @"UINavigationController",
                         @"tabbarTitle": @"通讯录",
                         @"imageName": @""},
                       @{@"className": @"UINavigationController",
                         @"tabbarTitle": @"设置",
                         @"imageName": @"UINavigationController"}];
    
    self.viewControllers = [self createVCArray:array];
    
}

- (__kindof UIViewController *)createVCWithClassName:(NSString *)className tabberTitle:(NSString *)tabbarTilte tabbarImageName:(NSString *)tabbarImageName {
    Class vcClass = NSClassFromString(className);
    UIViewController *vc = [vcClass new];
    vc.tabBarItem.title = tabbarTilte;
    vc.tabBarItem.image = [UIImage imageNamed:tabbarImageName];
    return vc;
}

- (NSArray<UIViewController *> *)createVCArray:(NSArray *)vcConfigMessageArr {
    
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dic in vcConfigMessageArr) {
        UIViewController *vc = [self createVCWithClassName:dic[@"className"] tabberTitle:dic[@"tabbarTitle"] tabbarImageName:dic[@"tabbarImageName"]];
        [mArr addObject:vc];
    }
    return mArr;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
